package com.appwoo.txtws.adapter;

import android.app.Activity;
import android.content.Context;
import android.content.res.Resources;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.appwoo.txtws.bean.SeniorListBean;
import com.appwoo.txtws.component.Global;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class ScreenWeekAdapter extends ArrayAdapter<SeniorListBean>
{
  private Context context;
  private Map<Integer, View> viewMap = new HashMap();

  public ScreenWeekAdapter(Activity paramActivity, List<SeniorListBean> paramList)
  {
    super(paramActivity, 0, paramList);
    this.context = paramActivity;
  }

  private boolean hiLightItem(SeniorListBean paramSeniorListBean)
  {
    String str1 = paramSeniorListBean.getStartime();
    String str2 = paramSeniorListBean.getEndtime();
    String str3 = Global.getTodayTime(this.context);
    int i = str3.compareToIgnoreCase(str1);
    boolean bool = false;
    if (i >= 0)
    {
      int j = str3.compareToIgnoreCase(str2);
      bool = false;
      if (j <= 0)
        bool = true;
    }
    return bool;
  }

  public View getView(int paramInt, View paramView, ViewGroup paramViewGroup)
  {
    View localView = (View)this.viewMap.get(Integer.valueOf(paramInt));
    SeniorListBean localSeniorListBean;
    String str3;
    String str4;
    LinearLayout localLinearLayout;
    TextView localTextView3;
    String str5;
    String str6;
    if (localView == null)
    {
      localView = ((Activity)getContext()).getLayoutInflater().inflate(2130903204, null);
      localSeniorListBean = (SeniorListBean)getItem(paramInt);
      String str1 = localSeniorListBean.getStartime();
      String str2 = localSeniorListBean.getEndtime();
      str3 = localSeniorListBean.getCmdtype();
      str4 = localSeniorListBean.getWeek();
      localLinearLayout = (LinearLayout)localView.findViewById(2131493518);
      TextView localTextView1 = (TextView)localView.findViewById(2131493519);
      TextView localTextView2 = (TextView)localView.findViewById(2131493520);
      localTextView3 = (TextView)localView.findViewById(2131493521);
      localTextView1.setText(str1.substring(0, 5));
      localTextView2.setText(str2.substring(0, 5));
      str5 = this.context.getResources().getString(2131427777);
      str6 = this.context.getResources().getString(2131427778);
      if (!"0".equals(str3))
        break label278;
      localTextView3.setText(str5);
      if (Global.getDay(this.context) != 0)
        break label341;
    }
    label278: label341: for (int i = 7; ; i = Global.getDay(this.context))
    {
      if ((str4.equals(i)) && (hiLightItem(localSeniorListBean)))
        localLinearLayout.setBackgroundColor(this.context.getResources().getColor(2131230781));
      this.viewMap.put(Integer.valueOf(paramInt), localView);
      return localView;
      if ("1".equals(str3))
      {
        localTextView3.setText(str6);
        break;
      }
      if (!"2".equals(str3))
        break;
      localTextView3.setText(str6 + "+" + str5);
      break;
    }
  }
}

/* Location:           C:\Documents and Settings\Administrator\classes_dex2jar.jar
 * Qualified Name:     com.appwoo.txtws.adapter.ScreenWeekAdapter
 * JD-Core Version:    0.6.2
 */